package com.cauli.gateway.feignService;

import com.cauli.gateway.feignService.Interceptor.FeignInterceptor;
import com.cauli.gateway.feignService.model.MenuVO;
import com.cauli.gateway.feignService.model.RoleVO;
import com.cauli.utils.util.ResultResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author Cauli
 * @date 2023/8/31 2:55
 * @description 在调用接口里使用 Interceptor
 */
@FeignClient(name = "netdisk-account", configuration = FeignInterceptor.class)
public interface AccountFeignService {
    /**
     * 返回一个账号所拥有的权限码集合
     *
     * @return
     */
    @RequestMapping("/menu/getPermissionList/")
    ResultResponse<List<MenuVO>> getPermissionList();

    /**
     * 根据用户ID获取详细信息
     *
     * @param userId
     * @return
     */
    @RequestMapping("/role/getRoleByUserId/{userId}")
    ResultResponse<List<RoleVO>> getRoleByUserId(@PathVariable Long userId);
}

